import request from '@/utils/request'

/**
 * 
 * @returns 所有的权限节点
 */
export function getPermissionsList() {
    return request({
        url: '/sys/permission',
    })
}
/**
 * 
 * 添加权限节点
 */
export function savePermissions(data) {
    return request({
        url: '/sys/permission',
        method: 'post',
        data
    })
}

/**
 * 
 * @param {*} id 
 * @returns 
 * 根据id更新权限节点
 */
export function setPermissions(data) {
    return request({
        url: `sys/permission/${data.id}`,
        method: 'put',
        data
    })
}
/**
 * 
 * @param {*} id 
 * @returns 
 * 根据id获取权限节点
 */
export function getPermissions(id) {
    return request({
        url: `sys/permission/${id}`,
    })
}
/**
 * 
 * @param {*} id 
 * @returns 
 * 根据id删除权限节点
 */
export function delPermissions(id) {
    return request({
        url: `sys/permission/${id}`,
        method: 'delete'
    })
}


